<?php

/**
 * BbPlayers form base class.
 *
 * @method BbPlayers getObject() Returns the current form's model object
 *
 * @package    vogue
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseBbPlayersForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'          => new sfWidgetFormInputHidden(),
      'first_name'  => new sfWidgetFormInputText(),
      'last_name'   => new sfWidgetFormInputText(),
      'nick'        => new sfWidgetFormInputText(),
      'about'       => new sfWidgetFormTextarea(),
      'position_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('BbPositions'), 'add_empty' => false)),
      'def_img'     => new sfWidgetFormInputText(),
      'team_id'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('BbTeams'), 'add_empty' => false)),
      'number'      => new sfWidgetFormInputText(),
      'born'        => new sfWidgetFormInputText(),
      'height'      => new sfWidgetFormInputText(),
      'weight'      => new sfWidgetFormInputText(),
      'education'   => new sfWidgetFormInputText(),
      'experience'  => new sfWidgetFormInputText(),
      'birthday'    => new sfWidgetFormDate(),
      'birth_place' => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'id'          => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'first_name'  => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'last_name'   => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'nick'        => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'about'       => new sfValidatorString(),
      'position_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('BbPositions'), 'required' => false)),
      'def_img'     => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'team_id'     => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('BbTeams'), 'required' => false)),
      'number'      => new sfValidatorInteger(),
      'born'        => new sfValidatorString(array('max_length' => 255)),
      'height'      => new sfValidatorInteger(),
      'weight'      => new sfValidatorInteger(),
      'education'   => new sfValidatorString(array('max_length' => 255)),
      'experience'  => new sfValidatorString(array('max_length' => 255)),
      'birthday'    => new sfValidatorDate(),
      'birth_place' => new sfValidatorString(array('max_length' => 255)),
    ));

    $this->widgetSchema->setNameFormat('bb_players[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'BbPlayers';
  }

}
